#ifndef __CILENT__
#define __CILENT__
#include "myheader.h"
// 定义宏
typedef enum {
    CD = 1,
    PWD,
    LS,
    MKDIR,
    RMDIR,
    PUTS,
    GETS,
    REMOVE,
    QUIT,  // 添加QUIT命令
    ERROR_COMMAND
} CommandType;

typedef struct {
    CommandType commend;  // 改为CommandType
    int length;
    char data[1024];
} Train;

bool is_valid_command(CommandType cmd, const char* param, int num_params);
int parse_command(char* input, Train* ptrain);
int recvn(int sockfd, void *buf, ssize_t length);
int sendn(int sockfd, void *buf, ssize_t length);
int getsCommand(int sockfd);
int putsCommand(int sockfd,char *filename);
#endif 
